//package com.example.mongo.appmongo.config;
//
//import org.springframework.beans.BeansException;
//import org.springframework.beans.factory.config.BeanPostProcessor;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.lang.Nullable;
//import org.springframework.transaction.annotation.AnnotationTransactionAttributeSource;
//
///**
// * @author sjw
// * @className UserBeanPostProcessor
// * @date 2021/9/29 19:01
// * @description: TODO
// */
//
//public class UserBeanPostProcessor implements BeanPostProcessor {
//
//    @Nullable
//    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
//        System.out.println(beanName);
//        if(bean instanceof AnnotationTransactionAttributeSource || "transactionAttributeSource".equals(beanName) ){
//            return new UserAnnotationTransactionAttributeSource();
//        }
//        return bean;
//    }
//
//
//    @Nullable
//    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
//        System.out.println(beanName);
//        if(bean instanceof AnnotationTransactionAttributeSource || "transactionAttributeSource".equals(beanName) ){
//            return new UserAnnotationTransactionAttributeSource();
//        }
//        return bean;
//    }
//
//
//}
